This application claims priority under 35 U.S.C. xc2xa7xc2xa7119 and/or 365 to 0101412.5 filed in the United Kingdom on Jan. 19, 2001; the entire content of which is hereby incorporated by reference.
This invention relates to a computer graphics system, and in particular to a system allowing representation of the effects of illumination through transparent, refractive bodies.
As is well known, when light passes through a solid transparent body, it is refracted. That is, rays of light are bent at the intersection between two materials having different refractive indices. When such a body is curved, or has a thickness which varies over its surface, this can have the result that light rays are focussed onto some parts of a surface, which is being illuminated through the solid body, rather than onto other areas.
Thus, the bottom of a pool of water, or the surface on which a wine glass is standing, include some regions which are lit very much more than other regions. These patterns are called caustic patterns.
The present invention relates to a method for rendering these caustic patterns in a computer graphics system, in particular in a system which produces real-time images.
In the field of computer graphics, several different types of image generation technique are known. For example, images can be generated by a technique known as ray-tracing, in which the paths of light rays are traced from a projection plane into a scene. Thus, an image of the scene is formed on the projection plane. Another example is the technique of particle-tracing, in which the paths of light particles are traced, as they are emitted from a light source until they intercept a viewing plane.
However, the techniques of ray-tracing and particle-tracing cannot generally be used to produce real-time images, as each scene typically takes many minutes or hours, if not days in the case of particle-tracing, to produce an image.
A further alternative technique, which can more easily be used to produce images in real-time, is scan-line rendering. Scan-line rendering involves mathematically projecting the objects in a scene onto a projection plane. A shading algorithm is then used to colour the objects.
Conventional scan-line rendering techniques and shading algorithms do not take into account the effects of refraction of light through transparent media. As a result, such techniques fail to reproduce caustics patterns which are generated.
A document xe2x80x9cOpen GL-rendering of Underwater Causticsxe2x80x9d, available on the internet on Feb. 5, 2000, at the URL http://toolbox.sgi.com/TasteofDT/documents/OpenGL/tips/caustics/, describes a technique for simulating such effects. Specifically, a pre-calculated illumination map is applied to the surface, in the same way that surface textures can be applied to objects.
However, this technique produces repetitive patterns and, since it is not linked to any actual geometry in the scene, is inherently unrealistic.
According to a first aspect of the present invention, there is provided a method for producing an image of a scene including a refractive object.
More specifically, according to the first aspect of the invention, there is provided a method of generating an illumination map, representing a scene including a refractive object, the method comprising:
for one or more light source, creating a first bitmap for the refractive object, the bitmap comprising a plurality of pixels;
for each of said pixels in the first bitmap, mapping said pixel to a pixel in a second bitmap, the mapping representing the effect of refraction on light passing through the object; and
adding the effects of the light illuminating the pixels in the first bitmap into said second bitmap.